<?php

namespace App\Service;

use Hyperf\HttpServer\Contract\ResponseInterface as HttpResponse;

class ReturnMessageService
{
    protected $response;
    public function __construct(HttpResponse $response)
    {
        $this->response = $response;
    }

    public function buildReturnMessage($success, $message, $code)
    {
        $result = array();
        $result['success'] = $success;
        $result['message'] = $message;
        $result['code'] = $code;
        return $this->response->json(
            $result
        );
    }
}